package com.java.java8.util.functioninterfacedemo;

import java.util.HashMap;

/**
 * @author liyanhao
 * @Date 2023-03-26 18:51
 */
@FunctionalInterface
public interface BiConsumer<T, U> {
    void accept(T y, U u);
}

class TestBiConsumer {
    public static void main(String[] args) {
        BiConsumer<Integer, Integer> r = (a, b) -> System.out.println((a + b));
        r.accept(1, 2);
        HashMap<String, String> cityMap = new HashMap<>();
        cityMap.put("Guangdong", "Guangzhou");
        cityMap.put("Zhejiang", "Hangzhou");
        cityMap.put("Jiangsu", "Nanjing");
        cityMap.forEach((key, value) -> {
            System.out.println(String.format("%s 的省会是 %s", key
                    , value));
        });

    }

}
